package org.hp.service.user;

import com.github.pagehelper.PageHelper;
import org.apache.ibatis.annotations.Param;
import org.hp.bean.User;
import org.hp.dao.user.UserDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Resource
    UserDao userDao;

//    @Override
//    public List<User> queryAll() {
//        return userDao.queryAll();
//    }

    @Override
    public List<User> queryList(int page,int limit,String aname) {
        PageHelper.startPage(page,limit);
        return userDao.queryList(aname);
    }

     @Override
    public User queryOne(int aid) {
        return userDao.queryOne(aid);
    }

    @Override
    public int update(User user) {
        return userDao.update(user);
    }

    @Override
    public int add(User user) {
        return userDao.add(user);
    }

    @Override
    public int addId(User user) {
        return userDao.addId(user);
    }

    @Override
    public int addRole(int aid) {
        return userDao.addRole(aid);
    }

    @Override
    public int PseudoDel(int aid) {
        return userDao.PseudoDel(aid);
    }

    @Override
    public List<User> PqueryAll(@Param("page") int page, @Param("limit") int limit, @Param("auserId") String auserId) {
        PageHelper.startPage(page,limit);
        return userDao.PqueryAll(auserId);
    }

    @Override
    public User PqueryOne(int aid) {
        return userDao.PqueryOne(aid);
    }

    @Override
    public int recover(int aid) {
        return userDao.recover(aid);
    }

    @Override
    public int Abandoned(int aid) {
        return userDao.Abandoned(aid);
    }
}
